<template>
  <div style="margin-left: 15px; margin-right: 10px;">
    <div style="margin-bottom: 12px;">
      <a-row>
        <a-col span="12"><span style="font-size: 16px;">填报单位：{{ form?.unit }}</span></a-col>
        <a-col span="12"><span style="font-size: 16px;">填报日期：{{ form?.fillDate }}</span></a-col>
      </a-row>
    </div>
    <a-descriptions bordered :column="4">
      <a-descriptions-item label="开钻日期" :span="2">{{ form?.drillingDate || "---" }}</a-descriptions-item>
      <a-descriptions-item label="完钻日期" :span="2">{{ form?.completionDate || "---" }}</a-descriptions-item>
      <a-descriptions-item label="地理位置" :span="2">{{ form?.wellLocation || "---" }}</a-descriptions-item>
      <a-descriptions-item label="构造位置" :span="2">{{ form?.wellConstruct || "---" }}</a-descriptions-item>
      <a-descriptions-item label="钻头程序" :span="4">
        <a-descriptions-item v-for="(drillItem, index) in form.drillList" :key="index">
          <p>钻头名称: {{ drillItem?.name || "---" }}</p>
          <p>外径: {{ drillItem?.outerDiameter || "---" }}</p>
          <p>深度: {{ drillItem?.deep || "---" }}</p>
        </a-descriptions-item>
      </a-descriptions-item>
      <a-descriptions-item label="钻具扣型" :span="4">
        <a-descriptions-item v-for="(typeItem, index) in form.drillToolType" :key="index">
          <p>国标: {{ typeItem?.nationalStandard || "---" }}</p>
        </a-descriptions-item>
      </a-descriptions-item>
      <a-descriptions-item label="钻井设备">{{ form?.drillingEquipment || "---" }}</a-descriptions-item>
      <a-descriptions-item label="钻具最大外径(mm)">{{ form?.maxDrillingOuterDiameter || "---" }}</a-descriptions-item>
      <a-descriptions-item label="地层岩性">{{ form?.lithology || "---" }}</a-descriptions-item>
      <a-descriptions-item label="井径(mm)">{{ form?.wellDiameter || "---" }}</a-descriptions-item>
      <a-descriptions-item label="造斜点(m)">{{ form?.obliquePointDeep || "---" }}</a-descriptions-item>
      <a-descriptions-item label="卡点井斜(°)">{{ form?.pointWellSlope || "---" }}</a-descriptions-item>
      <a-descriptions-item label="卡点方位(°)">{{ form?.pointWellLocation || "---" }}</a-descriptions-item>
      <a-descriptions-item label="狗腿度(°)">{{ form?.stuckPointsDoglegDegree || "---" }}</a-descriptions-item>
      <a-descriptions-item label="增/降斜点1(m)">{{ form?.riseDeclinePoint1 || "---" }}</a-descriptions-item>
      <a-descriptions-item label="井斜1(°)">{{ form?.wellSlope1 || "---" }}</a-descriptions-item>
      <a-descriptions-item label="方位1(°)">{{ form?.azimuth1 || "---" }}</a-descriptions-item>
      <a-descriptions-item label="狗腿度1(°)">{{ form?.doglegDegree1 || "---" }}</a-descriptions-item>
      <a-descriptions-item label="增/降斜点2(m)">{{ form?.riseDeclinePoint2 || "---" }}</a-descriptions-item>
      <a-descriptions-item label="井斜2(°)">{{ form?.wellSlope2 || "---" }}</a-descriptions-item>
      <a-descriptions-item label="方位2(°)">{{ form?.azimuth2 || "---" }}</a-descriptions-item>
      <a-descriptions-item label="狗腿度2(°)">{{ form?.dogleg_degree2 || "---" }}</a-descriptions-item>
      <a-descriptions-item label="电缆信息" :span="4">
        <a-descriptions bordered>
          <a-descriptions-item label="电缆型号">{{ cable?.cableId || "---" }}</a-descriptions-item>
          <a-descriptions-item label="电缆直径(mm)">{{ cable?.diameter || "---" }}</a-descriptions-item>
          <a-descriptions-item label="电缆拉断力(KN)">{{ cable?.breakingForce || "---" }}</a-descriptions-item>
          <a-descriptions-item label="电缆投产日期">{{ form?.putDate || "---" }}</a-descriptions-item>
          <a-descriptions-item label="电缆接头">{{ form?.cableGlands || "---" }}</a-descriptions-item>
          <!-- <a-descriptions-item label="电缆伸长率">{{ form?.cableElongation || "---" }}</a-descriptions-item> -->
          <a-descriptions-item label="拉力测试日期" :span="1">{{ form?.tensileTestDate || "---" }}</a-descriptions-item>
        </a-descriptions>
      </a-descriptions-item>
      <a-descriptions-item label="仪器弱点" :span="1">{{ form?.instrumentWeaknesses || "---" }}</a-descriptions-item>
      <!-- <a-descriptions-item label="仪器最大外径">{{ form?.maxOuterDiameter || "---" }}</a-descriptions-item>
            <a-descriptions-item label="仪器长度">{{ form?.instrumentLength || "---" }}</a-descriptions-item> -->
      <a-descriptions-item label="仪器抓捞位置" :span="1">{{ form?.salvagePosition || "---" }}</a-descriptions-item>
      <a-descriptions-item label="最小抗拉伸力(lbf)" :span="1">{{ form?.minTensileResistance || "---" }}</a-descriptions-item>
      <a-descriptions-item label="最小抗压缩力(lbf)" :span="2">{{ form?.minCompressiveForces || "---" }}</a-descriptions-item>
      <a-descriptions-item label="马笼头" :span="4">{{ form?.bridle }}
        <a-descriptions bordered>
          <!-- <a-descriptions-item label="马笼头L1">{{ form?.bridleL1 || "---" }}</a-descriptions-item>
                    <a-descriptions-item label="马笼头L2" :span="2">{{ form?.bridleL2 || "---" }}</a-descriptions-item>
                    <a-descriptions-item label="马笼头D1">{{ form?.bridleD1 || "---" }}</a-descriptions-item>
                    <a-descriptions-item label="马笼头油壬尺寸D2" :span="2">{{ form?.bridleD2 || "---" }}</a-descriptions-item> -->
          <a-descriptions-item label="马笼头示意图">{{ form.bridleFileId }}</a-descriptions-item>
        </a-descriptions>
      </a-descriptions-item>
      <a-descriptions-item label="其它说明" :span="4">{{ form?.otherNotes || "---" }}</a-descriptions-item>
      <a-descriptions-item label="填报人" :span="2">{{ form?.fillPerson || "---" }}</a-descriptions-item>
      <a-descriptions-item label="联系方式" :span="2">{{ form?.phoneNumber || "---" }}</a-descriptions-item>
    </a-descriptions>
  </div>
</template>
<script setup>
import { getOne } from "@/api/salvage/threadCard";
import WellCables from '@/api/tool/cable.js'
const props = defineProps({
  reportId: {
    type: String
  }
})
const form = ref({});
const cable = ref({});
// 监听数据变化
watch(() => props.reportId, () => {
  console.log('props.reportId', props.reportId);
  getThreadCard()
})

// 获取穿心解卡信息
function getThreadCard() {
  getOne(props.reportId).then(res => {
    console.log('getThreadCard', res);
    form.value = res
    if (res.cableId) {
      WellCables.queryOne(res.cableId).then(response => {
        cable.value = response
      })
    }
  })
}
getThreadCard()

</script>